<template>
  <dt-modal-info ref="edit" :title="title" :label-width="100" :width="800">
    <div class="point-table">
      <dt-grid ref="table" :onFetch="onFetch" :height="400" />
    </div>
  </dt-modal-info>
</template>

<script>
  import columnOpt from '../opt/expandColumn'
  import activityMgr from '@/biz/customerForCode/activity'

  export default {
    data() {
      return {
        title: '点位详情',
        info: {}
      }
    },
    methods: {
      show(data) {
        console.log(data, 'data')
        this.info = data
        this.$refs.edit.show()
        this.$refs.table.init(this, new columnOpt.pointDetailColumn(this))
        this.$refs.table.fetch()
      },
      onFetch(data) {
        let params = {
          id: this.$route.query.activityId,
          buildingId: this.$dt.buildInfo().housesId,
          pointPositionId: this.info.id
        }
        return activityMgr.detail(params).then((res) => {
          return res
        })
      }
    }
  }
</script>

<style lang="scss" scoped></style>
